{% load staticfiles %}
<!DOCTYPE html>
<html lang="zh-CN">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>监控数据展示</title>
	<link rel="stylesheet" href="{% static 'css/reset.css' %}">
	<link rel="stylesheet" href="{% static 'css/new.css' %}">
	<link rel="stylesheet" href="{% static 'css/style.css' %}">
	<script src="{% static 'js/vue.min.js' %}"></script>
	<script src="{% static 'js/jquery.min.js' %}"></script>
</head>

<body>
	<div id="stars">
        <div class="star" style="top: 0px;left: 500px;"></div>
    </div>

	<div class="h-container">
		<div class="h-login">

			<div class="h-login-head">
				<em></em>
				<span>登录</span>	
			</div>
            <form class="form-horizontal" action="/login/" method="post">
			<div class="h-login-body">

				<div class="h-login-row">
					<label><em class="h-icon h-icon-user"></em></label>
					<div><input type="text" class="l-input" name="user" placeholder="输入用户名"></div>
				</div>
				<div class="h-login-row">
					<label><em class="h-icon h-icon-psd"></em></label>
					<div><input type="password" class="l-input" name="pwd" placeholder="输入密码"></div>
				</div>
			</div>

			<div class="h-login-btns">
				<button type="submit" class="login_btn">登录</button>
			</div>
            </form>
			<div class="error-msg"></div>
		</div>
	</div>

	<script src="{% static 'js/start.js' %}"></script>
	<script src="{% static 'js/api.js' %}"></script>
{#	<script>#}
{#		starting(document.getElementById('stars'), 'star', 60);#}
{##}
{#		;(function(){#}
{#			var btn = $(".login_btn"),#}
{#				user = $("[name='user']"),#}
{#				psd = $("[name='pwd']"),#}
{#				err = $(".error-msg"),#}
{#				lock = false;#}
{#			var unLocked = function() {#}
{#				lock = false;#}
{#				btn.text("登录").removeClass("disabled");#}
{#			};#}
{#			var locked = function() {#}
{#				lock = true;#}
{#				btn.text("登录中...").addClass("disabled");#}
{#				err.text("");#}
{#			};#}
{##}
{#			btn.on("click", function(){#}
{#				if(lock) return;#}
{#				var sVal = $.trim(user.val()),#}
{#					pVal = $.trim(psd.val()),#}
{#					text = "";#}
{#				if(sVal == "" || pVal == "") {#}
{#					text = "用户名或密码不能为空";#}
{#					err.text(text);#}
{#					return;#}
{#				}#}
{#				locked();#}
{#                #}
{#				$.ajax({#}
{#					url: getRequstURL('login'),#}
{#					data: {#}
{#						username: sVal,#}
{#						password: pVal#}
{#					},#}
{#					type: "POST",#}
{#					success: function(res) {#}
{#						// if(res.status == 0) {#}
{#						// 	window.location.href = res.url;#}
{#						// }#}
{#						unLocked();#}
{#					},#}
{#					error: function(error) {#}
{#						unLocked();#}
{#					}#}
{#				});#}
{#			});#}
{#			#}
{#		})();#}
{#	</script>#}
</body>

</html>